<?php
//***********************************************************************
//author: Pete "mash" Morgan - pedromorgan@gmail.com
//***********************************************************************
require_once('config.inc.php');


//** Location of the ajax remote script eg http://server.com/path/to/dir/remote.php
// NOT implemented in this version but ledt this stuff here
$url_base = 'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']);
$url_feed = $url_base.'/remote.php?fetch=';

header('content-type: application/vnd.mozilla.xul+xml');

// send xml tags from php and <? in "body" confuses php with short_open_tags=on
echo '<?xml version="1.0"?>';
echo '<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>';
echo '<?xml-stylesheet href="style_sheets/firebase-xul.css"   type="text/css"?>';
?>
<window
	id="wMain"
	title="Fire Base - XUL"
	orient="vertical"
	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    onload="loadTables()">

<!--## All the Javascripts -->
<script src="js/httprequest.js" language="JavaScript"></script>
<script src="js/utils.js" language="JavaScript"></script>
<script src="js/firebase-xul.js" language="JavaScript"></script>

<!--## Header block -->
<hbox id="header">
	<label id="caption" value="Fire Base"/>
    <label id="ver" value="<?php echo VERSION ?>"/>
	<spacer flex="1"/>
	<label id="dbLabel" value="<?php echo $db_label; ?>"/>
</hbox>

<hbox flex="1">
    <vbox flex="1">
        <tabbox>
            <tabs id="tableTabs" selectedIndex="0" style="padding: 5px;" oncommand="loadTables()">
                <tab label="All" />
                <tab label="Tables"/>
                <tab label="Views"/>
            </tabs>
        </tabbox>

        <listbox flex="40" onselect="loadCols(this);"  id="tables-list">
            <listhead>
            <listheader label="Items" />
            </listhead>
            <listcols>
                <listcol flex="1" />
            </listcols>
        </listbox>
    </vbox>
    <vbox flex="1">

            <label flex="1" id="table-label" value="tableName"  />
            <listbox flex="40" id="cols-list">
                <listhead>
                <listheader label="Items" />
                </listhead>
                <listcols>
                    <listcol flex="1" />
                </listcols>
                <listitem key="olddays">
                <listcell label="The Old Days" />
                </listitem>
            </listbox>
            <!--
            <tree flex="20" hidecolumnpicker="true" seltype="single">
            <treecols>
                <treecol label="Column Name" flex="1"/>
            </treecols>
            <treechildren id="colsTreeChildren" flex="1">
            </treechildren>
            </tree>
            -->
    </vbox>
</hbox>

  <splitter collapse="before" resizeafter="farthest" resizebefore="closest">
    <grippy/>
  </splitter>

<!-- # Preview data -->
<tree flex="1" style='overflow: auto;' hidecolumnpicker="true">
    <treecols id="previewCols"/>
    <treechildren id="previewTreeChildren"/>
</tree>

<!--
<iframe flex="1" src="preview.php" name="preview_frame"/>
-->
<statusbar>
    <statusbarpanel label="" id="tables-count-stats-label" />
    <statusbarpanel label="" id="status-label" flex="2" />
    <progressmeter mode="determined" value="0" id="progressMeter" flex="2" />
    <statusbarpanel label="" id="cols-count-status-label"/>
</statusbar>

</window>

